package com.jiutianniao.p2p.acctrans.core.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jiutianniao.p2p.acctrans.core.dal.dao.AccountFreezeLogDao;
import com.jiutianniao.p2p.acctrans.core.dal.model.AccountFreezeLogDO;
import com.jiutianniao.p2p.acctrans.core.service.AccountFreezeLogService;
import com.jiutianniao.p2p.base.web.page.MybatisPageHelper;
import com.jiutianniao.p2p.base.web.page.PageVo;
import com.jiutianniao.p2p.trans.client.model.AccountFreezeLogQueryDto;

@Service("accountFreezeLogService")
public class AccountFreezeLogServiceImpl implements AccountFreezeLogService {

	@Resource
	private AccountFreezeLogDao accountFreezeLogDao;

	@Override
	public Long saveFreezeLog(AccountFreezeLogDO accountFreezeLogDO) {
		accountFreezeLogDao.saveAccountFreezeLog(accountFreezeLogDO);
		return accountFreezeLogDO.getId();
	}

	public PageVo queryFreezeLogPageByConditions(

	AccountFreezeLogQueryDto accountFreezeLogQueryDto) {

		Integer pgNumber = accountFreezeLogQueryDto.getPageNo();

		Integer pgSize = accountFreezeLogQueryDto.getPageSize();

		PageVo page = new PageVo();
		page.setPageNo(pgNumber);
		page.setPageSize(pgSize);
		MybatisPageHelper.setPageVo(page);

		List list = accountFreezeLogDao
				.queryByCondition(accountFreezeLogQueryDto);
		page.setRows(list);
		return page;
	}
}
